﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;

namespace DoxygenBrowserAddin.Utils
{
    public class CodeLocation
    {
        Dictionary<vsCMElement, string> _codeScope;

        public CodeLocation()
        {
            _codeScope = new Dictionary<vsCMElement, string>();
        }

        public Dictionary<vsCMElement, string> CodeScope
        {
            get { return _codeScope; }
        }

        public string InnerScope
        {
            get
            {
                string innerScope = string.Empty;
                if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementProperty))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementProperty];
                }
                else if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementFunction))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementFunction];
                }
                else if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementEvent))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementEvent];
                }
                else if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementVariable))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementVariable];
                }
                else if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementClass))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementClass];
                }
                else if (this.CodeScope.ContainsKey(vsCMElement.vsCMElementNamespace))
                {
                    innerScope = this.CodeScope[vsCMElement.vsCMElementNamespace];
                }
                return innerScope;

            }
        }

    }
}
